<?php
/*
 * https://www.kancloud.cn/manual/thinkphp5_1/353966
 * 还可以支持路由到动态的模块、控制器或者操作，例如：
// action变量的值作为操作方法传入
Route::get(':action/blog/:id', 'index/blog/:action');
// 变量传入index模块的控制器和操作方法
Route::get(':c/:a', 'index/:c/:a');*/

Route::get('think', function () {
    return 'hello,ThinkPHP5!';
});

Route::get('hello/:name', 'index/hello');

//Route::rule('/','Login/abc');
Route::rule('/', 'Index/index');
//Route::rule('login','Login/index');
//Route::get('new/:id','Login/abc');

Route::group('login', function () {
    Route::post('/', 'index');
    Route::get('a', 'aaa');
})->prefix('Login/');

Route::group('user', function () {
    Route::get(':page/:size/[:searchText]', 'userList');
    Route::post('addUser', 'addUser');
    Route::put('editUser', 'editUser');
})->prefix('User/')
    ->pattern(['page' => '\d+', 'size' => '\d+']);

Route::group('role', function () {
    Route::get('', 'index');
    Route::post('addOne', 'addOne');
    Route::put('editOne', 'editOne');
    Route::delete('delOne/:RoleId', 'delOne');
})->prefix('Role/')->pattern(['RoleId' => '\d+']);

// 部门
Route::group('depart', function () {
    Route::post('addOne', 'addOne');
    Route::put('editOne', 'editOne');
    Route::delete('delOne/:DeptId', 'delOne');
})->prefix('Depart/')->pattern(['DeptId' => '\d+']);
/**
 * 设备管理
 */
Route::group('DeviceCategory', function () {
    Route::post('addOne', 'addOne');
    Route::put('editOne', 'editOne');
    Route::delete('delOne/:fl_id', 'delOne');
})->prefix('DeviceCategory/')->pattern(['fl_id' => '\d+']);

Route::group('device', function () {
    Route::get('categoryDevice/:fl_id', 'categoryDevice'); // fl_id sbfl
    Route::get('account/:page/:size/[:sbdh]/[:sbmc]/[:azwz]', 'account');
    Route::get('searchDeviceByKeyword/:keyword', 'searchDeviceByKeyword');
    Route::post('addOne', 'addOne');
    Route::put('editOne', 'editOne');
    Route::delete('delOne/:sbid', 'delOne');
})->prefix('Device/')->pattern(['sbid' => '\d+','page' => '\d+', 'size' => '\d+']);

Route::group('DevicePart', function () {
    Route::post('editMore', 'editMore');
    Route::delete('delOne/:sbbjid', 'delOne');
})->prefix('DevicePart/')->pattern(['sbbjid' => '\d+']);

/**
 * 点检管理
 */
// 点检分类
Route::group('CheckStandard', function () {
    Route::get(':page/:size/[:StandardTypeId]', 'getList');
    Route::post('addOne', 'addOne');
    Route::post('copyOne', 'copyOne');
//    Route::get('addMore', 'addMore');
    Route::put('editOne', 'editOne');
    Route::delete('delOne/:StandardId', 'delOne');
})->prefix('CheckStandard/')
->pattern(['page' => '\d+', 'size' => '\d+','StandardId' => '\d+','StandardTypeId' => '\d+']);
// 点检项
Route::group('CheckStandardItem', function () {
    Route::get(':page/:size/[:StandardId]', 'getList');
    Route::post('addOne', 'addOne');
    Route::post('copyOne', 'copyOne');
    Route::put('editOne', 'editOne');
    Route::delete('delOne/:ItemId', 'delOne');
})->prefix('CheckStandardItem/')
->pattern(['page' => '\d+', 'size' => '\d+','StandardId' => '\d+','ItemId' => '\d+']);

// 点检路线
Route::group('PatrolLine', function () {
    Route::get(':page/:size', 'getList');
    Route::post('addOne', 'addOne');
    Route::put('editOne', 'editOne');
    Route::delete('delOne/:LineID', 'delOne');
    Route::get('resetOne/:LineID', 'resetOne');  //重置任务
})->prefix('PatrolLine/')->pattern(['page' => '\d+', 'size' => '\d+','LineID' => '\d+']);
// 点检设备
Route::group('PatrolDevice', function () {
    Route::get('getLineDevice/[:LineID]', 'getLineDevice');
//    Route::get(':page/:size/[:LineID]', 'getList');
    Route::post('addOne', 'addOne');
    Route::put('editOne', 'editOne');
    Route::delete('delOne/:PatrolDeviceID', 'delOne');
    Route::get('resetOne/:PatrolDeviceID', 'resetOne');  //重置任务
})->prefix('PatrolDevice/')->pattern([ 'PatrolDeviceID' => '\d+','LineID' => '\d+']);
// 巡检任务
Route::group('PatrolTask', function () {
    Route::get(':page/:size/:LineID/:CheckState/:CheckResultState/:Sbdh', 'getList');
    Route::get('', 'task');
})->prefix('PatrolTask/')->pattern(['page' => '\d+', 'size' => '\d+','StandardId' => '\d+']);


//公共接口
Route::group('info', function () {
    Route::get('/userAll', 'userAll');
    Route::get('/departAll', 'departAll');
    Route::get('/rolesAll', 'rolesAll');
    Route::get('/deviceCategory', 'deviceCategory');
    Route::get('/checkStandardType', 'checkStandardType');
    Route::get('/checkStandardCategory', 'checkStandardCategory');
    Route::get('/choseCycleType', 'choseCycleType');
    Route::get('/devicePosition', 'devicePosition');
    Route::get('/deviceParts/:id', 'deviceParts');
    Route::get('/patrolLine', 'patrolLine');
})->prefix('Info/')->pattern(['id' => '\d+']);
return [

];
